/**
 * Copyright &copy; 2012-2017 <a href="https://vivo.com">vivo</a> All rights reserved.
 */
package com.vivo.system.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.vivo.system.entity.SmsTemplate;
import com.vivo.system.dao.SmsTemplateDao;

/**
 * 短信模板Service
 * @author jyangye
 * @version 2018-03-06
 */
@Service
@Transactional(readOnly = true)
public class SmsTemplateService extends CrudService<SmsTemplateDao, SmsTemplate> {

    @Autowired
    private SmsTemplateDao smsTemplateDao;

	public SmsTemplate get(String id) {
		return super.get(id);
	}

	public SmsTemplate getByCompId(String compId) {
	    List<SmsTemplate> list = smsTemplateDao.getListByCompId(compId);
		return list.size() > 0 ? list.get(0) : null;
	}

	public List<SmsTemplate> findList(SmsTemplate smsTemplate) {
		return super.findList(smsTemplate);
	}
	
	public Page<SmsTemplate> findPage(Page<SmsTemplate> page, SmsTemplate smsTemplate) {
		return super.findPage(page, smsTemplate);
	}
	
	@Transactional(readOnly = false)
	public void save(SmsTemplate smsTemplate) {
		super.save(smsTemplate);
	}
	
	@Transactional(readOnly = false)
	public void delete(SmsTemplate smsTemplate) {
		super.delete(smsTemplate);
	}
	
}